package misc

/**
  * Created by shichen on 2017/5/10.
  */
object ImplicitDemo extends App {
  def display(input: String) = println(input)
  implicit def typeConverter(input: Int): String = input.toString
  implicit def typeConverter(input: Boolean): String =
    if (input) "true" else "false"

  //已经有了boolean到string的方法
  //implicit def booleanConverter(input: Boolean):String = if (input) "true" else "false"

  display("1212")
  display(12)
  display(true)
}
